Skip to content

Dev - #713

Merged
fatemeh-i merged 14 commits into
mainfrom
dev
Aug 12, 2026
Merged

Dev#713
fatemeh-i merged 14 commits into
mainfrom
dev

Conversation

@fatemeh-i

Copy link
Copy Markdown
Member

No description provided.

@fatemeh-i
fatemeh-i requested review from Hossein-ab99 and a lite review from Copilot August 12, 2026 08:47
@fatemeh-i
fatemeh-i merged commit 244008f into main Aug 12, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several “dev” improvements across services: operational configuration tweaks (health/vault/consul), persistence schema/model extensions in matching-gateway, and idempotency + query/index optimizations in market/accountant components.

Changes:

  • Extend matching-gateway pair settings with chart flags and per-pair categories (new table + Kotlin DTO/model/service changes).
  • Improve market persister idempotency and query performance (trade/order duplicate handling, new indexes, updated SQL).
  • Refine local/dev runtime configuration (docker-compose port exposure changes, actuator probes, vault imports, Kafka container bean wiring, WebClient timeouts).

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
wallet/wallet-app/src/main/resources/application.yml Enables actuator health probes and adjusts Consul health-check settings; reduces Hibernate SQL logging.
otp/otp-app/src/main/kotlin/co/nilin/opex/otp/app/proxy/SMSIRProxy.kt Updates SMS text template and URI build behavior.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/resources/schema.sql Adds internal_chart/global_chart columns and creates pair_category table.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/util/Convertor.kt Maps new PairSetting fields (chart flags + categories).
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/service/PairSettingInitializer.kt Populates new chart-flag columns during initialization insert.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/model/PairSettingModel.kt Adds chart flags and transient categories to the persisted model.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/model/PairCategoryModel.kt Introduces model for pair_category rows.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/model/PairCategory.kt Adds enum representing pair categories.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/impl/PairSettingServiceImpl.kt Loads/saves categories alongside pair settings; updates caching behavior.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/dto/PairSetting.kt Extends DTO with chart flags and categories.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/dao/PairSettingRepository.kt Updates custom insert query to include new columns.
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/dao/PairCategoryRepository.kt Adds repository abstraction for pair categories.
matching-gateway/matching-gateway-app/src/test/kotlin/co/nilin/opex/matching/gateway/app/service/sample/Samples.kt Updates test sample PairSetting constructor usage.
matching-gateway/matching-gateway-app/src/main/resources/application.yml Adds Vault config import.
market/market-ports/market-persister-postgres/src/test/kotlin/co/nilin/opex/market/ports/postgres/impl/TradePersisterTest.kt Adds tests for duplicate trade idempotency vs collision handling.
market/market-ports/market-persister-postgres/src/test/kotlin/co/nilin/opex/market/ports/postgres/impl/OrderPersisterTest.kt Adds tests for duplicate order create idempotency and touch-update-date behavior.
market/market-ports/market-persister-postgres/src/main/resources/schema.sql Adds indexes and enforces trade uniqueness with cleanup + column widening to BIGINT.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/TradePersisterImpl.kt Implements duplicate trade handling with collision detection and reassignment.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/OrderPersisterImpl.kt Makes create path idempotent and updates order-status timestamps + update_date touch.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/dao/TradeRepository.kt Adds findBySymbolAndTradeId and adjusts isBuyer logic in projection query.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/dao/OrderStatusRepository.kt Improves “most recent status” ranking ordering to be more deterministic.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/dao/OrderRepository.kt Adds touchUpdateDateByOuid and optimizes criteria query using lateral join + CTE.
market/market-ports/market-eventlistener-kafka/src/main/kotlin/co/nilin/opex/market/ports/kafka/listener/config/KafkaConsumerConfig.kt Exposes listener containers as beans instead of manually starting them.
market/market-core/src/main/kotlin/co/nilin/opex/market/core/event/RichOrderUpdate.kt Adds updateDate to update events.
docker-compose.local.yml Adds multiple Postgres services and changes port bindings.
api/api-app/src/main/kotlin/co/nilin/opex/api/app/config/RateLimitConfig.kt Refactors reactive flow to defer rate-limit execution and default handling.
accountant/accountant-ports/accountant-wallet-proxy/src/main/kotlin/co/nilin/opex/accountant/ports/walletproxy/config/WebClientConfig.kt Adds connection pooling/timeouts and configures Reactor client connector.
accountant/accountant-ports/accountant-eventlistener-kafka/src/main/kotlin/co/nilin/opex/accountant/ports/kafka/listener/config/AccountantKafkaConfig.kt Converts listener container wiring to explicit @Bean methods; adjusts producer/consumer beans.
accountant/accountant-core/src/main/kotlin/co/nilin/opex/accountant/core/service/OrderManagerImpl.kt Adjusts published RichOrderUpdate numeric fields and timestamps.
accountant/accountant-core/src/main/kotlin/co/nilin/opex/accountant/core/inout/RichOrderUpdate.kt Adds updateDate to update events.
accountant/accountant-core/src/main/kotlin/co/nilin/opex/accountant/core/inout/RichOrder.kt Adds createDate field.
accountant/accountant-app/src/main/resources/application.yml Enables Consul query passing.
Suppressed comments (1)

docker-compose.local.yml:56

  • postgres-market (and the other new Postgres services below) are now bound to all interfaces. Unless this is required, prefer 127.0.0.1: bindings to avoid exposing DB ports outside the local machine.
  postgres-market:
    ports:
      - "5438:5432"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +86 to 94
pairCategoryRepository.deleteByPair(pairSetting.pair).awaitFirstOrNull()
pairSetting.categories.forEach { category ->
pairCategoryRepository.save(
PairCategoryModel(
pair = pairSetting.pair,
category = category
)
)
}
Comment on lines +10 to +14
interface PairCategoryRepository : CoroutineCrudRepository<PairCategoryModel, String> {
fun findByPair(pair: String): Flow<PairCategoryModel>

fun deleteByPair(pair: String): Mono<Void>
} No newline at end of file
Comment on lines +168 to 171
private fun generateUniqueId(): Long {
return AtomicLong(System.currentTimeMillis() * 1000).incrementAndGet()
}
} No newline at end of file
Comment on lines +65 to +68
} catch (e: DataIntegrityViolationException) {
logger.info("order ${order.ouid} is duplicate; skipping create flow")
return
}
Comment on lines +75 to +93
ALTER TABLE trades
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN trade_id TYPE BIGINT;
ALTER SEQUENCE trades_id_seq AS BIGINT;

WITH duplicate_trades AS (
SELECT id
FROM (
SELECT id,
ROW_NUMBER() OVER (PARTITION BY symbol, trade_id ORDER BY id) AS rn
FROM trades
) ranked
WHERE rn > 1
)
DELETE
FROM trades t
USING duplicate_trades d
WHERE t.id = d.id;
CREATE UNIQUE INDEX IF NOT EXISTS uq_trades_symbol_trade_id on trades (symbol, trade_id);
Comment thread docker-compose.local.yml
Comment on lines +39 to +53
postgres-accountant:
ports:
- "5432:5432"
postgres-eventlog:
ports:
- "5433:5432"
postgres-auth:
ports:
- "5434:5432"
postgres-wallet:
ports:
- "5435:5432"
postgres-api:
ports:
- "5436:5432"
@@ -1,4 +1,4 @@
package co.nilin.opex.accountant.ports.kafka.listener.config
package co.nilin.opex.accountant.ports.kafka.listener.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants